﻿using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Cxj.WPF
{
    /// <summary>
    /// DialogWindow.xaml 的交互逻辑
    /// </summary>
    public partial class DialogWindow : Window
    {
        public DialogWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = "Sql 文件(*.sql)|*.sql|所有文件(*.*)|*.*";
            //openFileDialog.FilterIndex= 1;
            openFileDialog.Multiselect = true;// 允许多选
            if (openFileDialog.ShowDialog() == true)
            {
                //var file = openFileDialog.FileName;
                //openFileDialog.FileNames

                // 进行文件内容读取 
            }
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = "Sql 文件(*.sql)|*.sql|所有文件(*.*)|*.*";
            if (saveFileDialog.ShowDialog() == true)
            {
                // 获取保存文件路径 
                var fn = saveFileDialog.FileName;

                // 文件内容写入
            }
        }
    }
}
